home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 May / Macworld (1999-05).dmg / Shareware World / Info / 1984 OLM Issue 11 / 1984 OLM Issue 11.rsrc / TEXT_165.txt < prev    next >
Text File  |  1999-03-21  |  10KB  |  156 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. Using Personal Web Sharing to design Websites
  14. David Buxton
  15.  
  16. Previewing your website design before you upload it to the server can be frustrating because anchors in your local pages which use partial file paths will break when displayed in the browser. With the right Internet configuration and using Apple's Personal Web Sharing, you can preview pages exactly as they would appear if retrieved from a web server, without having an internet connection active (particularly useful if you use a modem to connect to the internet).
  17.  
  18. Apple includes a fully-functioning web server with Mac OS 8 and above. In this walkthrough I am using Personal Web Sharing 1.5, part of the default installation for Mac OS 8.5 (though all of this should work equally well with Mac OS 8 and 8.1). In addition, I assume that your Mac is not using Ethernet for printing and that AppleTalk is not used across remote connections. If you are not using Mac OS 8 you can use Social Engineering's excellent freeware Quid Pro Quo web server with Macintosh Open Transport networking architecture (Open Transport was introduced with System 7.5.3 and is part of every version of the System starting with 7.5.5).
  19.  
  20. Quid Pro Quo 2.0 works on any 68K or Power Macintosh running System 7.5 or later. The Quid Pro Quo application requires at least 3.5 MB of RAM to run (Web Sharing consumes approximately 2 MB by default, but has fewer features than Quid Pro Quo). The latest version of Quid Pro Quo can be found at http://www.socialeng.com
  21.  
  22. The following steps show how to configure your internet settings and point Web Sharing in the right direction so that you can view your pages on your hard drive as though they were located on a remote web server.
  23.  
  24. 1. Create a hosts file with your final site's domain name.
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. Create a new document in SimpleText with the domain name of your destination server followed by 'A 192.168.1.100'. The domain name, 'A' and the IP address should be separated by a single space. The domain name is that part of a URL which lies between 'http://' and the next slash character. Save this text file to the top level of the System Folder.
  35.  
  36. 2. Set-up TCP/IP with a dummy IP address.
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. Open the TCP/IP control panel and configure TCP/IP as shown in the picture above. Click 'Select Hosts File...' and locate the file we created in the previous step (you should have saved it in the System Folder). Then close the window and choose to save changes. Your computer will appear to freeze while it switches the TCP/IP connection (this can take as long as 30 seconds).
  57.  
  58. 3. Create a folder to hold your website.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. This folder will serve as the root directory of your website. On my computer I have called it Website so I don't get confused. This folder will contain all the files and folders just as you want them placed on the final web server. If your ISP requires you to save your pages within other directories, you should create additional folders within this dummy root folder to reflect the directories on the final web server, and keep your files within the last folder.
  75.  
  76. 4. Configure Personal Web Sharing to use your website folder as the root of the website.
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. Open the Web Sharing control panel and click on 'Select...' to locate and select the folder we created in step 3. If you want your browser to display a file by default when you enter the domain name of your server, click the 'Select...' button and locate the HTML file you wish to use as the default directory fie.
  91.  
  92. 5. Turn on Web Sharing
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109. Click the 'Start' button to activate Web Sharing. While the server starts up your computer will appear to freeze as Web Sharing initializes Open Transport and performs a reverse-lookup on the its IP address. Because we did not specify a domain name server, the reverse-lookup will be unsuccessful and the IP address will be displayed in its place.
  110. Now you can open your browser and enter the domain name specified in the hosts file to preview your pages. All anchors specified with partial URLs will work fine, including those relative to the root of the server!
  111. To use your Internet connection again, you should stop Web Sharing and then switch back to the correct configuration in TCP/IP. I have configured the Location Manager (part of Mac OS 8.x) to simplify the move between the Personal Web Sharing settings and my ISP's settings.
  112.  
  113. Tech Notes
  114. Why use 192.168.1.100 for the IP address?
  115. The range of IP address beginning 192.168.xxx.xxx are reserved for use by computers which do not have a permanent connection to the Internet. In case I inadvertently connect my computer to the Internet while using an address in this range, I can be certain that my computer will not attempt to use an address already assigned to another computer.
  116.  
  117. Why connect via AppleTalk (MacIP) in TCP/IP?
  118. I chose MacIP as the network interface in this walkthrough because a typical stand-alone Macintosh set-up will fail to locate other TCP/IP services (when using MacIP) and still successfully initialize TCP/IP services. With Ethernet or PPP, the Mac will not start TCP/IP if it does not receive a response on initializing TCP/IP. The disadvantage of MacIP is that AppleTalk must be active, and AppleTalk must use a network interface such as the built-in Ethernet or LocalTalk port, thus knocking out other connections on that port (such as your personal StyleWriter printer).
  119.  
  120. Can I do this on my lovely old Mac running System 7?
  121. Maybe. I don't know. The earliest public version of Open Transport requires a Macintosh running System 7.5.3 as a minimum. Classic networking (MacTCP) would be required to use System 7 with the Internet but it has fewer features than Open Transport networking. I understand that support for MacIP is available only under Open Transport. In addition, hosts files work differently with MacTCP. You would then have to locate a version of a web server which runs under System 7. I still need a good purpose for my vintage Macintosh II.
  122. How do I do all this using Quid Pro Quo?
  123.  
  124. The set-up for Quid Pro Quo is similar to that for Web Sharing. The documentation included with the Quid Pro Quo download explains what goes where in the preferences. Quid Pro Quo has all the features of Personal Web Sharing, and adds a few others. Understandably, Quid Pro Quo requires more RAM. I prefer Quid Pro Quo because one can specify several default names for a folder's index file and it appears to serve files a little faster. The latest version of Quid Pro Quo can be found at http://www.socialeng.com
  125. In the TCP/IP control panel, what does Router Address and Name Server Address mean? 
  126. The nice addresses we use to refer to websites (such as http://www.poopages.dircon.co.uk) conceal the real nature of all computers connected to the Internet. When you look for the address http://www.poopages.dircon.co.uk, your browser first queries a domain name server (DNS server). The domain name server takes the nice domain name and returns the ugly IP address of the computer referred to by that name. Armed with the IP address, your browser can locate and communicate with the server and retrieve whatever file you are interested in. 
  127.  
  128. When your Mac attempts to locate a computer on the Internet using the IP address, it passes all requests beyond its ken to the router. The router is another machine which has been configured to handle requests for machines beyond the immediate subnet's range of IP addresses. This is how your Mac can locate and communicate with a server on the other side of the world without having to know the specific route between your Mac and that other server. This is all to do with how the Internet consists of many smaller networks linked by routers, all talking the same language. Routers, subnets and domain name servers (but not forgetting switches) are the machines which perform the magic behind the Internet as we know it. TCP/IP is unintuitive, but simple once you know how - but I still can't get my head around the SMTP protocol and MX records... 
  129.  
  130. What is a partial file reference and what's so flipping great about it?
  131. A page on the Web is a plain-vanilla text file at heart. Objects such as links to other pages and images displayed within the page itself are indicated using the anchor (‚Äò<A HREF="">') and image (‚Äò<IMG SRC="">') mark-up tags within the text file. The address within the tag can have one of three forms:
  132.  
  133. *    Full URL
  134.  
  135. <IMG SRC="http://www.poopages.dircon.co.uk/pic/mypic.gif">
  136. Not good if you move the pages to another domain name.
  137.  
  138. *    Relative URL
  139.  
  140. <IMG SRC="pic/mypic.gif">
  141. Only permits a file reference relative to the location of the file containing the object tag. (Although most servers permit a file nearer the root directory to be referenced using '../' to indicate a higher directory.
  142.  
  143. *    Partial URL
  144.  
  145. <IMG SRC="/pic/mypic.gif">
  146. Objects specified using a preceding '/' are defined relative to the root of the server. This means one can ignore the domain name of the host server, while not restricting the reference to those files and directories immediately relative to the current file location. All of this allows one to quickly build a well-organized site and easily re-use graphics across several pages located in different parts of the site.
  147.  
  148. I hope this article wasn't too badly written and you can work out how to do this on your home machine. As I have indicated, I use Mac OS 8.5 and it works fine. I am certain this will all work on any Mac running 8.0 and 8.1. With the earlier versions of the System which support Open Transport, I don't know if Web Sharing can be persuaded to work, but I am almost certain that the same effect can be achieved using Quid Pro Quo. 
  149. Ô£øDavid Buxton
  150. <dbuxton@worldofwonder.net>
  151.  
  152.  
  153.   
  154.  
  155.  
  156.